package com.xy.mainp.novel.fragment;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.view.LayoutInflater;

import com.xy.mainp.NovelEndBinding;
import com.xy.mainp.R;
import com.xy.mainp.base.LazyFragment;
import com.xy.mainp.novel.widget.NovelFragmentHelper;

/**
 * Created by John on 2016/11/28.
 */

public class NovelEndFragment extends LazyFragment implements NovelFragmentHelper.NetDataListener {

    private String url;
    private NovelEndBinding binding;

    public NovelEndFragment() {

    }

    public NovelEndFragment(String url) {
        this.url = url;
    }

    @Override
    protected void onShow() {
        super.onShow();
        NovelFragmentHelper.getInstance(getActivity()).LoadNetData(url);
    }

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        binding = DataBindingUtil.inflate(LayoutInflater.from(getContext()), R.layout.fragment_novel_end, null, false);
        setContentView(binding.getRoot());
        NovelFragmentHelper.getInstance(getActivity()).setNetDateListener(this);
    }

    @Override
    public void deal(String result) {
        binding.tvBookEnd.setText(result);
    }
}
